package com.itheima.wms.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.itheima.pinda.base.entity.Entity;
import com.itheima.pinda.base.entity.SuperEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
import lombok.experimental.SuperBuilder;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

import static com.baomidou.mybatisplus.annotation.SqlCondition.EQUAL;
import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 库区
 * </p>
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@SuperBuilder
@TableName("wms_area")
@ApiModel(value = "Area", description = "库区")
public class AreaEntity extends Entity<Long> {

    private static final long serialVersionUID = 1L;

    /**
     * 仓库id
     */
    @ApiModelProperty(value = "仓库id")
    @NotNull(message = "仓库id不能为空", groups = {Save.class})
    @TableField(value = "warehouse_id")
    private Long warehouseId;
    /**
     * 编码
     */
    @ApiModelProperty(value = "编码")
    @NotEmpty(message = "编码不能为空", groups = {Save.class})
    @Length(max = 50, message = "编码长度不能超过50")
    @TableField(value = "code")
    private String code;
    /**
     * 名称
     */
    @ApiModelProperty(value = "名称")
    @NotEmpty(message = "名称不能为空", groups = {Save.class})
    @Length(max = 50, message = "名称长度不能超过50")
    @TableField(value = "name")
    private String name;
    /**
     * 温度类型 常温:CW、冷藏:LC、恒温:HW
     */
    @ApiModelProperty(value = "温度类型 常温:CW、冷藏:LC、恒温:HW")
    @NotEmpty(message = "温度类型 常温:CW、冷藏:LC、恒温:HW不能为空", groups = {Save.class})
    @Length(max = 10, message = "温度类型 常温:CW、冷藏:LC、恒温:HW长度不能超过10")
    @TableField(value = "temperature_type")
    private String temperatureType;
    /**
     * 承重类型 重型:ZX、轻型:QX
     */
    @ApiModelProperty(value = "承重类型 重型:ZX、轻型:QX")
    @NotEmpty(message = "承重类型 重型:ZX、轻型:QX不能为空", groups = {Save.class})
    @Length(max = 10, message = "承重类型 重型:ZX、轻型:QX长度不能超过10")
    @TableField(value = "bearing_type")
    private String bearingType;
    /**
     * 用途类型 入库缓存区：RKHCQ 出库缓存区：CKHCQ 存储区：CCQ  分拣区：FJQ 质检区：ZJQ
     */
    @ApiModelProperty(value = "用途类型 入库缓存区：RKHCQ 出库缓存区：CKHCQ 存储区：CCQ  分拣区：FJQ 质检区：ZJQ")
    @NotEmpty(message = "用途类型 入库缓存区：RKHCQ 出库缓存区：CKHCQ 存储区：CCQ  分拣区：FJQ 质检区：ZJQ不能为空", groups = {Save.class})
    @Length(max = 10, message = "用途类型 入库缓存区：RKHCQ 出库缓存区：CKHCQ 存储区：CCQ  分拣区：FJQ 质检区：ZJQ长度不能超过10")
    @TableField(value = "use_type")
    private String useType;
    /**
     * 类型
     */
    @ApiModelProperty(value = "类型")
    @TableField(value = "type")
    private String type;
    /**
     * 负责人id
     */
    @ApiModelProperty(value = "负责人id")
    @TableField(value = "person_id")
    private Long personId;
    /**
     * 负责人姓名
     */
    @ApiModelProperty(value = "负责人姓名")
    @NotEmpty(message = "负责人姓名不能为空", groups = {Save.class})
    @Length(max = 10, message = "负责人姓名长度不能超过10")
    @TableField(value = "person_name")
    private String personName;
    /**
     * 联系电话
     */
    @ApiModelProperty(value = "联系电话")
    @Length(max = 20, message = "联系电话长度不能超过20")
    @TableField(value = "phone")
    private String phone;
    /**
     * 库位数量
     */
    @ApiModelProperty(value = "库位数量")
    @TableField(value = "included_num")
    private Integer includedNum;
    /**
     * 状态 0 停用 1启用
     */
    @ApiModelProperty(value = "状态 0 停用 1启用")
    @TableField(value = "status")
    private Integer status;
    /**
     * 备注
     */
    @ApiModelProperty(value = "备注")
    @Length(max = 255, message = "备注长度不能超过255")
    @TableField(value = "remark")
    private String remark;
    /**
     * 创建人
     */
    @ApiModelProperty(value = "创建人")
    @Length(max = 50, message = "创建人长度不能超过50")
    @TableField(value = "create_name", fill = FieldFill.INSERT)
    private String createName;
    /**
     * 更新人
     */
    @ApiModelProperty(value = "更新人")
    @Length(max = 50, message = "更新人长度不能超过50")
    @TableField(value = "update_name", fill = FieldFill.INSERT_UPDATE)
    private String updateName;
    /**
     * 逻辑删除 0 删除
     */
    @ApiModelProperty(value = "逻辑删除 0 删除")
    @TableField(value = "logic_del")
    private Integer logicDel;
}
